package cn.rongdao.jrkabao.ui.deposit.fragment;

import android.view.View;

import com.mifengkong.frtools.http.request.callback.FRBaseObserver;

import java.util.List;

import cn.rongdao.jrkabao.bean.deposit.IncomeAndExpenditureBean;
import cn.rongdao.jrkabao.model.deposit.InComeModel;

/**
 * Created by jack on 2017/7/27
 */

public class FragmentIncome extends BaseFragmentIncomeAndExpenditure {

    @Override
    protected void requestData() {
        InComeModel.getInstance().execute(new FRBaseObserver<List<IncomeAndExpenditureBean>>(this) {
            @Override
            protected void onBaseNext(List<IncomeAndExpenditureBean> data) {
                if (null != data && data.size() > 0) {
                    mAdapter.setDataList(data);
                    emptyView.setVisibility(View.GONE);
                } else {
                    emptyView.initEmptyView("暂时没有任何收入\n可以邀请好友注册并取现赚取现金奖励");
                }
                runUiThread();
            }

            @Override
            protected void onBaseError(Throwable t) {
                super.onBaseError(t);
                runUiThread();
            }
        });
    }
}